package org.gourpg.model.chat;

import com.google.common.base.MoreObjects;
import com.google.common.base.Objects;

import java.sql.Timestamp;


public class ChatMessageDetail {
    /**
     * 消息编号，主键
     */
    private Long messageId;

    /**
     * 聊天室编号
     */
    private Integer messageChatId;

    /**
     * 聊天人
     */
    private Integer messagePersonId;

    /**
     * 信息发生时间
     */
    private Timestamp messageStartTime;

    /**
     * 信息内容，html格式，文件与图片走上传逻辑
     */
    private String messageContent;

    @Override
    public String toString() {
        return MoreObjects.toStringHelper(this)
                .add("messageId", messageId)
                .add("messageChatId", messageChatId)
                .add("messagePersonId", messagePersonId)
                .add("messageStartTime", messageStartTime)
                .add("messageContent", messageContent)
                .toString();
    }

    @Override
    public boolean equals(Object o) {
        if (o == null || getClass() != o.getClass()) return false;
        ChatMessageDetail that = (ChatMessageDetail) o;
        return Objects.equal(getMessageId(), that.getMessageId()) && Objects.equal(getMessageChatId(), that.getMessageChatId()) && Objects.equal(getMessagePersonId(), that.getMessagePersonId()) && Objects.equal(getMessageStartTime(), that.getMessageStartTime()) && Objects.equal(getMessageContent(), that.getMessageContent());
    }

    @Override
    public int hashCode() {
        return Objects.hashCode(getMessageId(), getMessageChatId(), getMessagePersonId(), getMessageStartTime(), getMessageContent());
    }

    public Long getMessageId() {
        return messageId;
    }

    public void setMessageId(Long messageId) {
        this.messageId = messageId;
    }

    public Integer getMessageChatId() {
        return messageChatId;
    }

    public void setMessageChatId(Integer messageChatId) {
        this.messageChatId = messageChatId;
    }

    public Integer getMessagePersonId() {
        return messagePersonId;
    }

    public void setMessagePersonId(Integer messagePersonId) {
        this.messagePersonId = messagePersonId;
    }

    public Timestamp getMessageStartTime() {
        return messageStartTime;
    }

    public void setMessageStartTime(Timestamp messageStartTime) {
        this.messageStartTime = messageStartTime;
    }

    public String getMessageContent() {
        return messageContent;
    }

    public void setMessageContent(String messageContent) {
        this.messageContent = messageContent;
    }

    public ChatMessageDetail() {
    }

    public ChatMessageDetail(Long messageId, Integer messageChatId, Integer messagePersonId, Timestamp messageStartTime, String messageContent) {
        this.messageId = messageId;
        this.messageChatId = messageChatId;
        this.messagePersonId = messagePersonId;
        this.messageStartTime = messageStartTime;
        this.messageContent = messageContent;
    }
}
